<?php 
require_once '../include/includefiles.php';
require_once '../include/userislogin.php';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>文章管理</title>
<link href="images/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="images/jquery-1.7.2.min.js"></script>
</head>

<body>
<table width="100%" align="center" bgcolor="#F7F8F9">
  <tr bgcolor="#E1E5EE">
    <td height="30" colspan="7" align="center" bgcolor="#E1E5EE"><form name="form1" method="post" action="actions.php?act=art_seach">
      文章名称
      ：
          <input name="user" type="text" id="user" value="<?php echo $_GET['user']?>">
        <input type="submit" name="Submit" value="查询">
    </form>    </td>
  </tr>
  <tr align="center" bgcolor="#F2F2F2">
    <td height="30" bgcolor="#F2F2F2"><input type="checkbox" name="checkall" id="checkall" value="checkbox"></td>
    <td bgcolor="#F2F2F2">编号</td>
    <td height="30">标题</td>
    <td height="30">栏目</td>
	<td height="30">更新时间</td>
	<td height="30">作者</td>
    <td height="30">操作</td>
  </tr>
 
  <?php getart($_GET['user']);?>
   <tr align="center">
    <td height="25" colspan="7" align="center" valign="middle">
	<div class="tools">
	  <a class="user_del" href="#">批量删除</a>	</div>
	<div class="pagebar"><?php echo $pagebar;?></div></td>
  </tr>
   <tr align="center">
     <td height="25" colspan="7" align="left" valign="middle"><a href="art_add.php">新增文章</a></td>
   </tr>
</table>
  <script>
    $(function(){
       $('#user').focus();
       $('#checkall').click(function(){
            if($(this).attr("checked")){
               $("[name='cbuserid']").attr("checked",true);
            }else{
               $("[name='cbuserid']").attr("checked",false);
            }
       });

       $('.user_del').click(function(){
	       var ischecked = false;
		   var ids="";
           $("[name='cbuserid']").each(function(){
		       if($(this).attr("checked")){
			     ischecked = true;
				 ids+=$(this).val()+",";
			   }
		   });
		   if(!ischecked){
		      alert('请选择文章!');
		   }else{
		     var r=confirm("确认要删除吗?");
			 if(r){
  			   window.location="actions.php?act=art_del&ids="+ids;
			 }
		     
		   }
       });
       $('.user_del1').click(function(){
    	     var r=confirm("确认要删除吗?");
			 if(r){
			   return true;
			 }else{
				 return false;
		     }
       });
    });
  
  </script>
</body>
</html>
